<?php

/**
 * Файл формирования маршрутов. Происходит инициализация объекта маршрутизации и задание правил маршрутизации
 * 
 * @author Lazarev N.V.
 */


$router = new Zend_Controller_Router_Rewrite();

require 'adminroutes.php';

// News routes
$router->addRoute('index',
     new Zend_Controller_Router_Route('', array('module' => 'default', 'controller' => 'news', 'action' => 'default'))
);
$router->addRoute('news',
     new Zend_Controller_Router_Route('news/:page', array('module' => 'default', 'controller' => 'news', 'action' => 'index', 'page' => 1))
);
$router->addRoute('new',
     new Zend_Controller_Router_Route('new/:newId', array('module' => 'default', 'controller' => 'news', 'action' => 'view'))
);

// Articles routes
$router->addRoute('solutions',
     new Zend_Controller_Router_Route('solutions/:page', array('module' => 'solutions', 'controller' => 'index', 'action' => 'index', 'page' => 1))
);
$router->addRoute('solution',
     new Zend_Controller_Router_Route('solution/:solutionId', array('module' => 'solutions', 'controller' => 'index', 'action' => 'view'))
);

// Products routes
$router->addRoute('products',
     new Zend_Controller_Router_Route('/products/:catId', array('module' => 'products', 'controller' => 'index', 'action' => 'index'))
);
$router->addRoute('product',
     new Zend_Controller_Router_Route('/product/:productId', array('module' => 'products', 'controller' => 'index', 'action' => 'view'))
);

// Designs routes
$router->addRoute('designs',
     new Zend_Controller_Router_Route('designs/:page', array('module' => 'designs', 'controller' => 'index', 'action' => 'index', 'page' => 1))
);
$router->addRoute('design',
     new Zend_Controller_Router_Route('design/:designId/', array('module' => 'designs', 'controller' => 'index', 'action' => 'view'))
);

// Towns routes
//$router->addRoute('towns',
//     new Zend_Controller_Router_Route('towns', array('module' => 'towns', 'controller' => 'index', 'action' => 'index'))
//);
//$router->addRoute('town',
//     new Zend_Controller_Router_Route('town/:townId', array('module' => 'towns', 'controller' => 'index', 'action' => 'view'))
//);

// Services routes
$router->addRoute('services',
     new Zend_Controller_Router_Route('services', array('module' => 'services', 'controller' => 'index', 'action' => 'index'))
);
$router->addRoute('service',
     new Zend_Controller_Router_Route('service/:serviceId', array('module' => 'services', 'controller' => 'index', 'action' => 'view'))
);

// Static routes
// About route
$router->addRoute('about',
     new Zend_Controller_Router_Route('about', array('module' => 'static', 'controller' => 'index', 'action' => 'about'))
);

$router->addRoute('area',
     new Zend_Controller_Router_Route('area', array('module' => 'static', 'controller' => 'index', 'action' => 'area'))
);

$router->addRoute('apply',
     new Zend_Controller_Router_Route('apply', array('module' => 'static', 'controller' => 'index', 'action' => 'apply'))
);

$router->addRoute('contacts',
     new Zend_Controller_Router_Route('contacts', array('module' => 'static', 'controller' => 'index', 'action' => 'contacts'))
);
